package com.zhao.retry.demo;

import com.zhao.retry.demo.service.DemoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

/**
 * Created on 2020/5/20.
 *
 * @author zhao
 * @email 136689260@qq.com
 */
@Slf4j
@Component
public class TestRunner implements CommandLineRunner {

    @Autowired
    private DemoService demoService;

    @Override
    public void run(String... args) throws Exception {
        demoService.service("abc");
        String[] strings = new String[1];
        strings[0] = "abc";
        demoService.service(strings);
        demoService.service(Arrays.asList(strings));
        Map<String, Object> stringObjectMap = new HashMap(16);
        stringObjectMap.put("abc", strings);
        demoService.service(stringObjectMap);
        Param param = new Param();
        param.setList(Arrays.asList(strings));
        param.setMap(stringObjectMap);
        param.setObjects(strings);
        demoService.service(new Param());
    }
}
